package com.htgd.gardenexpo.service.impl;

import com.htgd.gardenexpo.entity.GeConActivityFeedback;
import com.htgd.gardenexpo.dao.GeConActivityFeedbackDao;
import com.htgd.gardenexpo.service.GeConActivityFeedbackService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (GeConActivityFeedback)表服务实现类
 *
 * @author makejava
 * @since 2021-06-08 13:59:26
 */
@Service("geConActivityFeedbackService")
public class GeConActivityFeedbackServiceImpl implements GeConActivityFeedbackService {
    @Resource
    private GeConActivityFeedbackDao geConActivityFeedbackDao;

    /**
     * 通过ID查询单条数据
     *
     * @param
     * @return 实例对象
     */
    @Override
    public GeConActivityFeedback queryById() {
        return this.geConActivityFeedbackDao.queryById();
    }

    /**
     * 查询多条数据
     *
     * @param offset 查询起始位置
     * @param limit  查询条数
     * @return 对象列表
     */
    @Override
    public List<GeConActivityFeedback> queryAllByLimit(int offset, int limit) {
        return this.geConActivityFeedbackDao.queryAllByLimit(offset, limit);
    }

    @Override
    public List<GeConActivityFeedback> getinfoByActivityId(int id) {
        return this.geConActivityFeedbackDao.getinfoByActivityId(id);
    }

    /**
     * 新增数据
     *
     * @param geConActivityFeedback 实例对象
     * @return 实例对象
     */
    @Override
    public GeConActivityFeedback insert(GeConActivityFeedback geConActivityFeedback) {
        this.geConActivityFeedbackDao.insert(geConActivityFeedback);
        return geConActivityFeedback;
    }

    /**
     * 修改数据
     *
     * @param geConActivityFeedback 实例对象
     * @return 实例对象
     */
    @Override
    public GeConActivityFeedback update(GeConActivityFeedback geConActivityFeedback) {
        this.geConActivityFeedbackDao.update(geConActivityFeedback);
        return this.queryById();
    }

    /**
     * 通过主键删除数据
     *
     * @param
     * @return 是否成功
     */
    @Override
    public boolean deleteById() {
        return this.geConActivityFeedbackDao.deleteById() > 0;
    }

    @Override
    public boolean deleteByActivityId(int id) {
        return this.geConActivityFeedbackDao.deleteByActivityId(id) > 0;
    }
}
